/**
 * ClassName:Demo1_1
 * Package:PACKAGE_NAME
 * <p>
 * Description:演示栈内存溢出
 *
 * @author kiki
 * @create 2025-01-07 17:00
 * @Version 1.0
 */
//默认栈内存大小1024
// 用-Xss可以更改栈内存大小，设置为需要字节   --- 需要在VMoptions哪里调
public class Demo1_1 {
    private static int count;

    public static void main(String[] args) {
        try {
            method1();
        } catch (Throwable e) {
            e.printStackTrace();
            System.out.println(count);
        }
    }

    private static void method1(){
        count++;
        method1();
    }
}
